1. Field of the Invention
The present invention relates to a computer system, and deals more particularly with a method, system, and computer program product for using an inference engine, along with an enhanced scripting language, to aggregate constraints and/or preferences that are to be applied to affect program execution.
2. Description of the Related Art
It is often useful or required to be able to tailor the execution of a software program based on dynamically determined constraints or limitations of some portion of a system, and/or based on preferences provided by users or system administrators. As one example of when this type of tailoring is advantageous, when a computer user requests delivery of document content over a network connection (such as requesting a Web page from the World Wide Web or Internet), it is often preferable to perform one or more transformations on the requested document before transmitting it to the requester. The particular transformations to be performed may be tailored to constraints such as the type of device the user is currently using, the user agent or browser executing on the device, the type of connection and network bandwidth to the user""s device, and may also account for this user""s preferences related to, inter alia, Web document content.
Often, Web content is created for a generic audience, without regard to the limitations that might be preferable for different target audiences. For example, a Web document may contain relatively large embedded objects such as sound files, images, video, etc., or may contain links that will automatically retrieve objects of this type. When the target device is a relatively powerful machine with a large storage capacity such as a desktop computer connected over a local area network (LAN), then downloading this type of document content is unlikely to create problems. However, it is becoming increasingly common for users to connect to the Internet with small, handheld devices that have limited memory and storage, as well as limited display space and display screens with low resolution. Such devices, referred to commonly as xe2x80x9cconstrained devicesxe2x80x9d, also typically have low power CPUs and are capable of supporting only low bandwidth connections, therefore resulting in high network latency. When a document requester is using this type of constrained device, then there may not be sufficient space for receiving and storing large Web documents on the device. In addition, the processing capabilities of a constrained device may be insufficient for a document created without regard to the limitations of these devices. Furthermore, users of constrained devices typically connect to a network using relatively expensive wireless connections, and/or connections with limited bandwidth. In such cases, the cost of receiving data content can be prohibitive, and it becomes imperative that only content which is important and necessary be sent to the end user, and that this content be sent in a format appropriate for the user""s device.
Constrained devices that are commonly used in Internet communication include cellular phones, screenphones, pagers, and laptop computers. An example of this type of device is the Nokia 7110, a cellular phone with a maximum display area of 6 lines of text. Another example device is the WorkPad available from the International Business Machines Corporation (xe2x80x9cIBMxe2x80x9d). This device is a handheld computer typically configured with several megabytes of storage, where that storage is provided as Random Access Memory (xe2x80x9cRAMxe2x80x9d) to avoid the system overhead associated with other types of storage such as disk drives. (xe2x80x9cWorkPadxe2x80x9d is a registered trademark of IBM.)
Examples of the types of constraint-based tailoring that are desirable for a Web document include omitting images if the target device only supports a textual display or has very limited display space; converting text to speech if the target device is a wearable computing device with no display; transcoding full-color images to grayscale if the connection type is wireless, to reduce transmission time; omitting portions of the content that cannot be processed by the target user agent or browser; etc. Similar tailoring may be applied based on a user""s preferences. For example, a user might specify that he or she wishes to receive images except when using his or her WorkPad device, in which case the images are to be omitted, or that only the first 100 characters of a text file are to be transmitted when he or she is using a cell phone. Furthermore, a systems administrator may specify preferences that are to be applied, such as omitting images for documents requested by all employees in a particular department or other classification.
Traditionally, conditional logic is used to tailor the execution of a software program based on factors that may vary in value (such as those which have been described above), where the conditional logic is coded as an integral part of the software and accounts for expected values of predetermined factors. However, this approach has a number of disadvantages.
First, programming skill is required to include the conditional logic within the program. The programmer must write code to handle every expected factor, and every expected value of those factors.
Second, this approach is relatively inflexible: it is not possible to account for new factors (or new values of existing factors where the new values should be separately addressed), for example, without modifying the software. As is well known, modification of software is a costly process, involving debugging, redistribution, reinstallation, etc. In the previously-discussed scenario where the tailoring process is directed toward transforming Web document content, the factors which were described included the device type, network connection type, bandwidth, user agent or browser type, and user or administrator preferences. Given the proliferation of new computing devices, it is easy to see that statically-written conditional logic code of the form xe2x80x9cIF device-type=. . . THEN do . . . xe2x80x9d may need constant revision to properly account for the types of target devices which the program""s users may be using, and is therefore an unsatisfactory approach. It would be preferable to enable system administrators and/or end users to determine how the conditional logic should be structured, and how it should be modified when necessary, as these are the people most directly involved with day-to-day operation of the resulting system. However, it is unlikely that the administrators and users will have the required skills or training that would be required to modify the software. In addition, modification of the software requires that the source code has been provided, which is often not the case.
Third, the values of the various factors may come from different sources. The user agent type, for example, is typically found in the header of the document request message. The identification of the user, used to locate user preferences, may come from this header or may be determined in another manner (such as by using information from the header to consult an index of users or employees). The program must contain code to locate the values of each factor for which conditional logic will be executed, and thus needs to be modified to account for any new sources that may become available.
Fourth, this conditional logic approach, which may have to account for many values of many factors as well as interrelationships between them, makes the resulting program much more complicated and thus harder to write, debug, and maintain. The program may also execute more slowly due to the complicated conditional logic.
Finally, including the conditional logic within the code which uses the result of the logic is not an optimal design strategy. The core function of the code, which merely needs to use the result of the conditional logic, may be obscured due to the added complexity introduced by the code which determines the conditional result.
Accounting for the values of multiple factors and the interrelationships between the factors and their values is referred to herein as xe2x80x9caggregationxe2x80x9d. As a simple example of what is required, suppose a constraint for the user""s device indicates that images are to be transcoded from full color to 16 color; the connection type indicates that full color images are to be transcoded to grayscale; and the user""s preference for this device type using this connection type is to completely omit images. Intuitively, it can be seen that in this example the omission of images is the most restrictive and therefore probably the preferred content tailoring process. It is likely that more factors beyond those which have been described may become pertinent to the tailoring process. For example, time of day and day of the week may influence the cost of data transmission, or a user""s network subscription service may have graduated pricing based upon usage. As more factors and more values are added to the aggregation process, the complexity of determining the result increases substantially. For the reasons discussed above, using conditional logic coded directly into an application program is an unsatisfactory technique for performing the aggregation.
Accordingly, what is needed is an improved technique for tailoring software execution based upon an aggregation of information, where this technique does not suffer from the disadvantages that result from statically coding aggregation logic into the software that is to use the aggregation result .
An object of the present invention is to provide an improved technique for tailoring the execution of a software program based upon an aggregation of information.
It is another object of the present invention to provide this technique by aggregating constraints and/or preferences that influence the tailoring process.
Another object of the present invention is to provide this technique using an inference engine and an enhanced scripting language.
It is another object of the present invention to provide this technique whereby the aggregated constraints and/or preferences are used to tailor document content for delivery to a requester in a networking environment.
Still another object of the present invention is to provide this technique where the inference engine uses backward chaining.
Yet another object of the present invention is to provide an alternative where the inference engine uses forward chaining.
Other objects and advantages of the present invention will be set forth in part in the description and in the drawings which follow and, in part, will be obvious from the description or may be learned by practice of the invention.
To achieve the foregoing objects, and in accordance with the purpose of the invention as broadly described herein, the present invention provides a computer program product, a system, and a method for tailoring execution of a software program based on aggregated information. This technique comprises: transforming one or more rules expressed in an enhanced scripting language into rules expressed in an existing scripting language; executing an inference engine; and using the aggregated result in the software program. Executing the inference engine further comprises: processing the one or more rules expressed in the existing scripting language;
evaluating a plurality of values, wherein each of the values may express a constraint value or a preference value; and determining an aggregated result using the processed rules and the evaluated values.
The enhanced scripting language preferably comprises the existing scripting language with an additional notational element added, and the transformation further preferably comprises: locating each of the notational elements in each of the rules being transformed; replacing the located notational elements with a value-searching syntax when the located notation element was in a premise of the rule being transformed; and replacing the located notational elements with a value-setting syntax when the located notation element was in a conclusion of the rule being transformed. The notational element is preferably a character not normally used in the scripting language as an operator or to begin an identifier, such as the xe2x80x9c@xe2x80x9d character.
The technique may further comprise compiling the transformed rules prior to execution of the inference engine. The existing scripting language may be NetRexx.
The inference engine may be a backward chaining inference engine, or a forward chaining inference engine.